def exchange(x):
    lst = []
    for item in x:
        if 'A' <= item <= 'Z':
            lst.append(chr(ord(item) + 32))  # 大小转小写，+32
        elif 'a' <= item <= 'z':
            lst.append(chr(ord(item) - 32))
        else:
            lst.append(item)
    return ''.join(lst)


# 准备调用
s = input('请输入一个字符串：')
new_s = exchange(s)
print(new_s)
